import Vue from 'vue'
import Vuex from 'vuex'

import axios from 'axios'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    count: 1,
    navs: {}
  },
  mutations: {
    getNav(state, res) {
      state.navs = res.data.data
    }
  },
  actions: {
    getNav(text) {
      //导航
      axios
        .get("http://39.107.239.131/Tencent/public/index.php/index/index/nav")
        .then(res => {
          text.commit('getNav', res)
        });
    }
  },
  modules: {}
})